package bridge.channel.impl;

import bridge.channel.Pay;
import bridge.mode.IPayMode;

import java.math.BigDecimal;

/**
 * @author : DuJiabao
 * @Date : 2021/3/3 11:02
 * @Project : design-pattern
 * @File : null.java
 * @Desc :
 */
public class WechatPay extends Pay {
  public WechatPay(IPayMode payMode) {
    super(payMode);
  }

  @Override
  public boolean transfer(String uId, String tradeId, BigDecimal amount) {
    if (!payMode.security(uId)) {
      System.out.println("当前微信账户不安全");
      return false;
    }
    System.out.println("微信账户安全");
    System.out.println(uId + " 转账给 " + tradeId + " " + amount + " 元");
    return true;
  }
}
